Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Requested JsHelper buffer #156

Closed
wants to merge 20 commits into from

Conversation

challet
Copy link
Contributor

@challet challet commented Jul 22, 2011

hello CakePHP team.

While switching to the JsHelper, which is great to optimize the javascript code.
I had a problem with string bufferised from a requested action : the two requests (main one [http] and second one [requested] ) have each their buffer and it's not shared.
So some Js strings from requested ones are not in the main output.

I guess it's a known beahvior (each request have their own helpers). But if you consider to change this (at least for the Js Helper buffer), here is a patch to do this :

  • the "main" JsHelper register itself when beforeRender
  • the "requested" ones transmit their buffer to the "main" one, on their own afterRender

At the end, the "main" JsHelper collected all the buffers in one and can output it.

@challet
Copy link
Contributor Author

challet commented Jul 22, 2011

Sorry, only the last commit is to be taken into account : PathMotion@4d9afe8

I don't know how to put only this one here :/

@@ -223,7 +223,7 @@ class DataSource extends Object {
* @return array Array of sources available in this datasource.
* @access public
*/
function listSources($data = null) {
function cachedListSources($data = null) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't this break a pile of backwards compatibility?

@markstory
Copy link
Member

Seems like there are a bunch of other changes that are not part of the original pull request in here as well. Putting things on separate branches makes the pull requests work better.

@markstory markstory closed this Jul 23, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants